//---------------------------------------------------------------------
//  This file is part of the Background Motion solution.
// 
//  Copyright (C) Mindscape (TM).  All rights reserved.
//  http://www.mindscape.co.nz
// 
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//---------------------------------------------------------------------

using System.Collections.Generic;

using Mindscape.BackgroundMotion.Model;
using Mindscape.BackgroundMotion.Website.Controllers;
using Mindscape.BackgroundMotion.Website.Infrastructure;
using Mindscape.BackgroundMotion.Website.Views;

namespace Mindscape.BackgroundMotion.Website
{
  [CodeViewer("In building BackgroundMotion we used the Composite Web block to underpin our web application. The Composite Web block uses a Model View Presenter pattern to structure the logic within the system. See how this is put togethor by working through how the data on this page gets loaded and bound.")]
  [CodeViewerReference(1, @"\Clients\Website\Default.aspx", 15, 23, "The Latest Videos and Images are rendered out from the ContributionGrid user control")]
  [CodeViewerReference(2, @"\Clients\Website\Default.aspx.cs", 30, 44, "The control repeaters are bound from the View through property sets")]
  [CodeViewerReference(3, @"\Clients\Website\Presenters\DefaultPresenter.cs", 23, 27, "The Presenter is responsible for binding and does this when the View is loaded. The overridden OnViewLoaded method is bound to the ASP.NET Page Load event")]
  [CodeViewerReference(4, @"\Clients\Website\Controllers\ContributionController.cs", 147, 157, "The application controller for Contributions handles fetching the associated contributions using a LINQ query")]
  [CodeViewerReference(5, @"\Clients\Website\Controllers\ContributionController.cs", 307, 317, "ModeratedContributions itself is actually a seperate LINQ query which can be requeried. It returns an IQueryable<Contribution> set to allow this.")]
  public partial class Default : PageBase<DefaultPresenter, IDefaultView, IContributionController>, IDefaultView
  {
    /// <summary>
    /// A list of the latest "Video" contributions in the system
    /// </summary>
    public IList<Contribution> LatestVideos
    {
      set { LatestVideosContributionGrid.Contributions = value; }
    }

    /// <summary>
    /// A list of the latest "Image" contributions in the system
    /// </summary>
    public IList<Contribution> LatestImages
    {
      set { LatestImagesContributionGrid.Contributions = value; }
    }
  }
}